<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="../common/css/insert.css">
<title>UncheckedCommentSearch</title>
</head>
<body onload="search()">
	<div id="searchResults">
	</div>
	
	
	<script>
	function search(){

		
		$(document).ready(function() {
			$.ajax({
				type : "post",
				url : "../getBookComments.action",
				dataType : "json",
				success : function(data,textStatus) {
					var jsonarray = data.comments;
					var table = document.getElementById('searchResults');
					
					var tab="<table border='1' bordercolor='blue' width='200' height='10'>";
					
					
					//循环行
					for(var i=1;i<=jsonarray.length;i++)
			        {
						if(i==1){
							tab+="<tr>";
							tab+="<td>"+评论ID+"</td>";
				       		tab+="<td>"+用户ID+"</td>";
				       	 	tab+="<td>"+书籍ID+"</td>";
				       		tab+="<td>"+评论时间+"</td>";
				       		tab+="<td>"+评论状态+"</td>";
				       	 	tab+="<td>"+评论内容+"</td>";
				       		tab+="<td>"+评星+"</td>";
				            tab+="</tr>";
						}else{
			            	tab+="<tr>";
			            	//循环列
			            	tab+="<td>"+jsonarray[i].commentid+"</td>";
			       			tab+="<td>"+jsonarray[i].userid+"</td>";
			       	 		tab+="<td>"+jsonarray[i].bookid+"</td>";
			       			tab+="<td>"+jsonarray[i].time+"</td>";
			       			tab+="<td>"+jsonarray[i].state+"</td>";
			       	 		tab+="<td>"+jsonarray[i].content+"</td>";
			       			tab+="<td>"+jsonarray[i].star+"</td>";
			            	tab+="</tr>";
						}
			        }
					
					tab+="</table>";
			       	table.innerHTML=tab;

				}
			});
		)};
	}
	</script>
</body>
</html>